import { ColumnProps } from "@/components/Table/type";
import { SchemaProps } from "@/components/Form/type";
export const columns: ColumnProps[] = [
  { type: "index", label: "#", width: 50 },
  { prop: "roleKey", label: "角色编码", search: { el: "input" } },
  { prop: "roleName", label: "角色名称", search: { el: "input" } },
  { prop: "action", label: "操作", width: 150, fixed: "right" }
];

export const schemas: SchemaProps[] = [
  {
    field: "roleKey",
    label: "角色编码",
    required: true,
    disabled: row => {
      return !!row.id;
    }
  },
  {
    field: "roleName",
    label: "角色名称",
    required: true
  },
  {
    field: "dataScope",
    label: "权限范围",
    required: true,
    el: "select",
    elProps: {
      options: [
        { label: "全部", value: 1 },
        { label: "本级或子级", value: 2 },
        { label: "本级", value: 3 },
        { label: "本级且本人", value: 4 }
      ]
    }
  }
];
